package org.example.hellogooglemaps;

import java.util.ArrayList;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;

import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.OverlayItem;

public class HelloItemizedOverlay extends ItemizedOverlay  {
	 
	AlertDialog.Builder dialog;
	private ArrayList<OverlayItem> mOverlays = new ArrayList<OverlayItem>();
	Context mContext;
	Intent i;
	Activity act;
	
	public HelloItemizedOverlay(Drawable defaultMarker,Intent i,Activity act) {
		  super(boundCenterBottom(defaultMarker));
		  this.act=act;
		  this.i=i;
	}
	public HelloItemizedOverlay(Drawable defaultMarker,Intent i,Activity act,int trucco) {
		  super(boundCenter(defaultMarker));
		  this.act=act;
		  this.i=i;
	}

	public void addOverlay(OverlayItem overlay) {
	    mOverlays.add(overlay);
	    populate();
	}
	
	@Override
	protected OverlayItem createItem(int i) {
	  return mOverlays.get(i);
	}

	@Override
	public int size() {
	  return mOverlays.size();
	}
	
	@Override
	protected boolean onTap(int index) {
	 //OverlayItem item = mOverlays.get(index);
	 //dialog = new AlertDialog.Builder(null);
	 //dialog.setTitle(item.getTitle());
	 //dialog.setMessage(item.getSnippet());
	 //dialog.show();  
	 //act.startActivity(i);
		
     return true;
	}

	


}